From e71c5d3ab544466754bb1b85358186e8d7e7b9f9 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 23 Jul 2009 21:52:32 +0200 Subject: [PATCH] Avoid unnecessary indirect call Call klass->draw_pixbuf directly inside gdk_window_draw_pixbuf instead of gdk_draw_pixbuf to avoid doing all checks twice. --- gdk/gdkwindow.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index ab2c3966cf..374a69c3a2 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -4225,6 +4225,7 @@ gdk_window_draw_pixbuf (GdkDrawable *drawable, gint y_dither) { GdkWindowObject *private = (GdkWindowObject *)drawable; + GdkDrawableClass *klass; if (GDK_WINDOW_DESTROYED (drawable)) return; @@ -4235,16 +4236,19 @@ gdk_window_draw_pixbuf (GdkDrawable *drawable, gc = _gdk_drawable_get_scratch_gc (drawable, FALSE); BEGIN_DRAW; + + klass = GDK_DRAWABLE_GET_CLASS (impl); + if (private->paint_stack) - gdk_draw_pixbuf (impl, gc, pixbuf, src_x, src_y, - dest_x - x_offset, dest_y - y_offset, - width, height, - dither, x_dither - x_offset, y_dither - y_offset); + klass->draw_pixbuf (impl, gc, pixbuf, src_x, src_y, + dest_x - x_offset, dest_y - y_offset, + width, height, + dither, x_dither - x_offset, y_dither - y_offset); else - gdk_draw_pixbuf (impl, gc, pixbuf, src_x, src_y, - dest_x - x_offset, dest_y - y_offset, - width, height, - dither, x_dither, y_dither); + klass->draw_pixbuf (impl, gc, pixbuf, src_x, src_y, + dest_x - x_offset, dest_y - y_offset, + width, height, + dither, x_dither, y_dither); END_DRAW; } -- 2.30.2